﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Hive.Core.Common.Shell;

namespace Hive.Core.Model
{
    /// <summary>
    /// A binary artifact represents an archive of a previously built package.
    /// </summary>
    public interface IBinaryArtifact
    {
        /// <summary>
        /// Gets the repository to which this artifact belongs.
        /// </summary>
        IBinaryRepository Repository { get; }

        /// <summary>
        /// Gets the name of the package to which the artifact belongs.
        /// </summary>
        string PackageName { get; }

        /// <summary>
        /// Gets the name of the branch to which the artifact belongs.
        /// </summary>
        string BranchName { get; }

        /// <summary>
        /// Get a version label that describes the version of the artifact.
        /// </summary>
        string VersionLabel { get; }

        /// <summary>
        /// Gets the time at which the artifact was created.
        /// </summary>
        DateTime CreationTimeUtc { get; }

        /// <summary>
        /// Extract the contents of the artifact into the specified directory.
        /// </summary>
        /// <param name="destinationDirectory">The destination directory.</param>
        /// <param name="shell">The command shell.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="destinationDirectory"/>
        /// or <paramref name="shell"/> is null.</exception>
        /// <exception cref="BinaryRepositoryException">Thrown if the operation failed.</exception>
        void Extract(DirectoryInfo destinationDirectory, IShell shell);
    }
}
